﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;

namespace Interfaces.Tareas
{
    public partial class EvaluarTarea : System.Web.UI.Page
    {
        Int64 id;
        bool relacionado;
        protected void Page_Load(object sender, EventArgs e)
        {
            if (!IsPostBack)
            {                
                Label2.Text = "La tarea " + Request.QueryString["Nm"] + " fue cerrada con exito ahora debe realizar la Evaluacion";
            }
            id = Convert.ToInt64(Request.QueryString["ID"]);
            relacionado = Convert.ToBoolean(Request.QueryString["R"]);
        }
        protected void Page_PreInit(object sender, EventArgs e)
        {


            if (Session["BuscarMaster"] != null)
            {
                this.MasterPageFile = (string)Session["BuscarMaster"];
            }
            else
            {
                this.MasterPageFile = "~/MasterPages/Default.Master";
            }
        }
        protected void Button1_Click(object sender, EventArgs e)
        {
            try
            {                
                bool resp = Processes.Tareas.GestorTareas.HacerEvaluacion(id, relacionado, TextBox1.Text);
                if (resp)
                    Response.Redirect("/Tareas/BuscarTarea.aspx");
            }
            catch (Exception ex)
            {
                LabelError.Text = ex.Message;
            }            
        }
    }
}